home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-02-27 | 977 b | 41 lines | [TEXT/CWIE] |
- /* SK8 © 1997 Apple Computer, Inc.
- This code is protected under the current SK8 License
- See http://sk8.research.apple.com/ for more information
- Apple Research Laboratories
- */
-
-
- import java.awt.*;
-
- class messagedialog extends Dialog {
- Label messagelabel;
- Button okbutton;
-
- // constructor.
-
- messagedialog(Frame dw, String text) {
- super(dw, "Message Window", true);
-
- //Create middle section.
- Panel p1 = new Panel();
- Label label = new Label(text);
- this.messagelabel = label;
- p1.add(label);
- add("Center", p1);
-
- //Create bottom row.
- Panel p2 = new Panel();
- p2.setLayout(new FlowLayout(FlowLayout.RIGHT));
- okbutton = new Button("Ok");
- p2.add(okbutton);
- add("South", p2);
-
- //Initialize this dialog to its preferred size.
- pack();
- }
-
- public boolean action(Event event, Object arg) {
- hide();
- return true;
- }
- }